import defaultConfig from './config'
import {getBaseURL} from '@/utils/assets'

let config = defaultConfig

if (window.globalConfig) {
  config = {...config, ...window.globalConfig}
}

if (config.baseURL === 'auto' || !config.baseURL) {
  config.baseURL = getBaseURL()
}

if (!/\/$/.test(config.baseURL)) {
  config.baseURL = config.baseURL + '/'
}

export default config
